Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to close #29 missing can isotp wait tx done flag to trigger a timeout #32

Conversation

muehlke
Copy link

@muehlke muehlke commented Jun 14, 2024

Closes #29

muehlke added 3 commits June 14, 2024 16:03
As of now, an UDS client run on the Linux ISOTP kernel module was not able to recognize a timeout error of a Flow Control frame not arriving in time after a multi-frame request. To fix this, the flag CAN_ISOTP_WAIT_TX_DONE is set on the socket. Otherwise writing the bytes of the SEND buffer to the ISOTP socket would incorrectly return the expected SEND buffer size, creating further problems like e.g. a timeout waiting on the response of the "sent"  request, since it was not really sent so the UDS server is not sending a response.
…n a client ISOTP socket with no responding server

With this test it can be assured that by having set the CAN_ISOTP_WAIT_TX_DONE flag on an ISOTP socket a communication error will be raised after trying to send a multi-frame request to an UDS server that will not send a FC frame within 1s.
}

// killing server so that no response is sent to client
ENV_TpFree(srv);
Copy link
Author

@muehlke muehlke Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added ENV_TpFree(srv); because for the test it is necessary that no server responds to the request so that we can get the desired timeout on the ISOTP socket. Because of the timeout error, the value of ret is <0, which was not the case before the flag was set on the socket.

@muehlke
Copy link
Author

muehlke commented Jun 19, 2024

@driftregion if test_tp_compliance.c is fine, then you may approve and merge this PR ✌️

@driftregion driftregion merged commit 24c60fd into driftregion:main Jul 10, 2024
1 check passed
@driftregion
Copy link
Owner

Thanks you for your contribution @muehlke

@muehlke muehlke deleted the 29-missing-can-isotp-wait-tx-done-flag-to-trigger-a-timeout branch July 10, 2024 10:02
@muehlke
Copy link
Author

muehlke commented Jul 10, 2024

You're welcome, keep up the good work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing CAN_ISOTP_WAIT_TX_DONE flag to trigger a timeout
2 participants